package com.api.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by PC on 2017/7/4.
 */
public class VerificationUtil {
    public static boolean isMobile(String str) {
        if(StringUtils.isBlank(str) ){
            return false;
        }
        Pattern p = null;
        Matcher m = null;
        boolean b = false;
        String regex="^1\\d{10}$";
        p = Pattern.compile(regex);// 验证手机号
        m = p.matcher(str);
        b = m.matches();
        return b;
    }

    public static boolean  isPwd(String pwd){
        Pattern p = null;
        Matcher m = null;
        boolean b = false;
        String regex="^[0-9a-zA-Z]{6,8}$";
        p = Pattern.compile(regex);// 验证密码
        m = p.matcher(pwd);
        b = m.matches();
        return b;

    }
}
